﻿using ClientOverflow.DataTransferObjects;
using System.Linq;

namespace ClientOverflow.CommunicationServices.Data
{
    /// <summary>
    /// AnswersFactory is resposible for generating users as objects from DB. In addition, it's
    /// resposible for generating answer as object based on crieteria.
    /// </summary>
    public static class AnswersFactory
    {
        public static DataObjects.Answer CreateAnswer(Answer answer)
        {
            return answer.ToDataObject();
        }

        public static DataObjects.Answer FindAnswer(Answer answer)
        {
            return DataObjects.Answer.Queryable.First(dbAnswer => dbAnswer.ID == answer.ID);
        }
    }
}